package com.quick.im.client.config;

import com.quick.im.common.thread.TaskToolExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 注册各种业务线程池
 *
 * @author xhh
 * @date 2022/2/19 20:17
 */
@Configuration
public class ExecutorPoolConfig {

//    /**
//     * 工具类线程池
//     *
//     * @return
//     */
//    @Bean(initMethod = "init", destroyMethod = "destroy")
//    public TaskToolExecutor ciToolExecutor() {
//        TaskToolExecutor ciToolExecutor = new TaskToolExecutor();
//        ciToolExecutor.setName("ciToolExecutor");
//        ciToolExecutor.setCoreSize(15);
//        ciToolExecutor.setMaxSize(32);
//        ciToolExecutor.setQueueSize(1024);
//        return ciToolExecutor;
//    }

    /**
     * 消息通知类线程池
     *
     * @return
     */
    @Bean(initMethod = "init", destroyMethod = "destroy")
    public TaskToolExecutor msgExecutor() {
        TaskToolExecutor msgExecutor = new TaskToolExecutor();
        msgExecutor.setName("msgExecutor");
        return msgExecutor;
    }

}
